padding-right: 17px;
}
- .message-dialog-body {
+ .message-dialog-description {
padding-left: 17px;
width: 28em;
}
- .message-dialog-body:rtl {
+ .message-dialog-description:rtl {
padding-left: 0px;
padding-right: 17px;
}
/* exported AccessDialogDBus */
-const { Clutter, Gio, GLib, GObject, Shell } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Shell, St } = imports.gi;
const CheckBox = imports.ui.checkBox;
const Dialog = imports.ui.dialog;
let grantLabel = options['grant_label'] || _("Grant Access");
let choices = options['choices'] || [];
- let contentParams = { title, description, body };
- let content = new Dialog.MessageDialogContent(contentParams);
+ let content = new Dialog.MessageDialogContent({ title, description });
this.contentLayout.add_actor(content);
this._choices = new Map();
let check = new CheckBox.CheckBox();
check.getLabelActor().text = name;
check.checked = selected == "true";
- content.insertBeforeBody(check);
+ content.add_child(check);
this._choices.set(id, check);
}
+ let bodyLabel = new St.Label({
+ text: body,
+ x_align: Clutter.ActorAlign.CENTER,
+ });
+ content.add_child(bodyLabel);
+
this.addButton({ label: denyLabel,
action: () => {
this._sendResponse(DialogResponse.CANCEL);
this.contentLayout.add(this._content);
this.prompt.bind_property('message', this._content, 'title', GObject.BindingFlags.SYNC_CREATE);
- this.prompt.bind_property('description', this._content, 'body', GObject.BindingFlags.SYNC_CREATE);
+ this.prompt.bind_property('description', this._content, 'description', GObject.BindingFlags.SYNC_CREATE);
this._workSpinner = null;
this._controlTable = null;
else
this._content = this._getContent();
- let contentParams = {
+ let contentBox = new Dialog.MessageDialogContent({
title: this._content.title,
- body: this._content.message,
- };
- let contentBox = new Dialog.MessageDialogContent(contentParams);
+ description: this._content.message,
+ });
this.contentLayout.add_actor(contentBox);
let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
var AuthenticationDialog = GObject.registerClass({
Signals: { 'done': { param_types: [GObject.TYPE_BOOLEAN] } },
}, class AuthenticationDialog extends ModalDialog.ModalDialog {
- _init(actionId, body, cookie, userNames) {
+ _init(actionId, description, cookie, userNames) {
super._init({ styleClass: 'prompt-dialog' });
this.actionId = actionId;
- this.message = body;
+ this.message = description;
this.userNames = userNames;
this._sessionUpdatedId = Main.sessionMode.connect('updated', () => {
let title = _("Authentication Required");
- let content = new Dialog.MessageDialogContent({ title, body });
+ let content = new Dialog.MessageDialogContent({ title, description });
this.contentLayout.add_actor(content);
if (userNames.length > 1) {
GObject.ParamFlags.READWRITE |
GObject.ParamFlags.CONSTRUCT,
null),
- 'body': GObject.ParamSpec.string(
- 'body', 'body', 'body',
- GObject.ParamFlags.READWRITE |
- GObject.ParamFlags.CONSTRUCT,
- null),
},
}, class MessageDialogContent extends St.BoxLayout {
_init(params) {
- this._title = new St.Label();
- this._description = new St.Label();
- this._body = new St.Label();
+ this._title = new St.Label({ style_class: 'message-dialog-title' });
+ this._description = new St.Label({ style_class: 'message-dialog-description' });
- ['title', 'description', 'body'].forEach(prop => {
- this[`_${prop}`].add_style_class_name(`message-dialog-${prop}`);
- });
-
- let textProps = {
- ellipsize: Pango.EllipsizeMode.NONE,
- line_wrap: true,
- };
- this._description.clutter_text.set(textProps);
- this._body.clutter_text.set(textProps);
+ this._description.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
+ this._description.clutter_text.line_wrap = true;
let defaultParams = {
style_class: 'message-dialog-content',
this.add_child(this._title);
this.add_child(this._description);
- this.add_child(this._body);
}
get title() {
return this._description.text;
}
- get body() {
- return this._body.text;
- }
-
set title(title) {
this._setLabel(this._title, 'title', title);
}
this._setLabel(this._description, 'description', description);
}
- set body(body) {
- this._setLabel(this._body, 'body', body);
- }
-
_setLabel(label, prop, value) {
label.set({
text: value || '',
});
this.notify(prop);
}
-
- insertBeforeBody(actor) {
- this.messageBox.insert_child_below(actor, this._body);
- }
});
_showKbdA11yDialog(deviceManager, newFlags, whatChanged) {
let dialog = new ModalDialog.ModalDialog();
- let title, body;
+ let title, description;
let key, enabled;
if (whatChanged & Clutter.KeyboardA11yFlags.SLOW_KEYS_ENABLED) {
title = enabled
? _("Slow Keys Turned On")
: _("Slow Keys Turned Off");
- body = _("You just held down the Shift key for 8 seconds. This is the shortcut " +
- "for the Slow Keys feature, which affects the way your keyboard works.");
+ description = _('You just held down the Shift key for 8 seconds. This is the shortcut ' +
+ 'for the Slow Keys feature, which affects the way your keyboard works.');
} else if (whatChanged & Clutter.KeyboardA11yFlags.STICKY_KEYS_ENABLED) {
key = KEY_STICKY_KEYS_ENABLED;
title = enabled
? _("Sticky Keys Turned On")
: _("Sticky Keys Turned Off");
- body = enabled
+ description = enabled
? _("You just pressed the Shift key 5 times in a row. This is the shortcut " +
"for the Sticky Keys feature, which affects the way your keyboard works.")
: _("You just pressed two keys at once, or pressed the Shift key 5 times in a row. " +
return;
}
- let contentParams = { title, body, styleClass: 'access-dialog' };
+ let contentParams = { title, description, styleClass: 'access-dialog' };
let content = new Dialog.MessageDialogContent(contentParams);
dialog.contentLayout.add_actor(content);
let labels = message.split('\n');
content.title = labels.shift();
- content.body = labels.join('\n');
+ content.description = labels.join('\n');
}
/* -------------------------------------------------------- */
_init(message, flags) {
let strings = message.split('\n');
let title = strings.shift() || null;
- let body = strings.shift() || null;
+ let description = strings.shift() || null;
super._init({ styleClass: 'prompt-dialog' });
let disksApp = Shell.AppSystem.get_default().lookup_app('org.gnome.DiskUtility.desktop');
- let content = new Dialog.MessageDialogContent({ title, body });
+ let content = new Dialog.MessageDialogContent({ title, description });
this.contentLayout.add_actor(content);
- content._body.clutter_text.ellipsize = Pango.EllipsizeMode.NONE;
let layout = new Clutter.GridLayout({ orientation: Clutter.Orientation.VERTICAL });
let grid = new St.Widget({ style_class: 'prompt-dialog-grid',
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
/* exported Indicator */
-const { Clutter, Gio, GLib, GObject, Shell } = imports.gi;
+const { Clutter, Gio, GLib, GObject, Shell, St } = imports.gi;
const Dialog = imports.ui.dialog;
const Main = imports.ui.main;
/* Translators: %s is an application name */
let title = _("Give %s access to your location?").format(name);
- let body = _("Location access can be changed at any time from the privacy settings.");
- let contentParams = { title, description, body };
- let content = new Dialog.MessageDialogContent(contentParams);
+ let content = new Dialog.MessageDialogContent({ title, description });
this.contentLayout.add_actor(content);
+ let infoLabel = new St.Label({
+ text: _('Location access can be changed at any time from the privacy settings.'),
+ x_align: Clutter.ActorAlign.CENTER,
+ });
+ content.add_child(infoLabel);
+
let button = this.addButton({ label: _("Deny Access"),
action: this._onDenyClicked.bind(this),
key: Clutter.KEY_Escape });
this._countDown = Meta.MonitorManager.get_display_configuration_timeout();
let title = _("Do you want to keep these display settings?");
- let body = this._formatCountDown();
+ let description = this._formatCountDown();
this._content = new Dialog.MessageDialogContent({
- title, body,
+ title, description,
x_expand: true,
y_expand: true,
});
return GLib.SOURCE_REMOVE;
}
- this._content.body = this._formatCountDown();
+ this._content.description = this._formatCountDown();
return GLib.SOURCE_CONTINUE;
}